﻿//===============================================================================
// Microsoft Innovation Centre - Western Europe
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System;
using System.Windows;
using System.Windows.Controls;

namespace Microsoft.WVB.UI
{
    internal static class VisualStates
    {
        public const string GroupAuthentication = "AuthenticationStates";
        public const string GroupActive = "ActiveStates";
        public const string GroupCalendarButtonFocus = "CalendarButtonFocusStates";
        public const string GroupCommon = "CommonStates";
        public const string GroupFocus = "FocusStates";
        public const string GroupSelection = "SelectionStates";
        public const string GroupWatermark = "WatermarkStates";
        public const string GroupFade = "FadeStates";
        public const string GroupExplorer = "ExplorerStates";
        public const string StateActive = "Active";
        public const string StateChecked = "Checked";
        public const string StateUnchecked = "Unchecked";
        public const string StateCalendarButtonFocused = "CalendarButtonFocused";
        public const string StateCalendarButtonUnfocused = "CalendarButtonUnfocused";
        public const string StateDisabled = "Disabled";
        public const string StateFocused = "Focused";
        public const string StateInactive = "Inactive";
        public const string StateMouseOver = "MouseOver";
        public const string StateNormal = "Normal";
        public const string StatePressed = "Pressed";
        public const string StateSelected = "Selected";
        public const string StateUnfocused = "Unfocused";
        public const string StateUnselected = "Unselected";
        public const string StateUnwatermarked = "Unwatermarked";
        public const string StateWatermarked = "Watermarked";
        public const string StateFormDisplayed = "FormDisplayed";
        public const string StateFormSubmitted = "FormSubmitted";
        public const string StateFormNotified = "FormNotified";
        public const string StateAnonymous = "Anonymous";
        public const string StateAuthenticated = "Authenticated";
        public const string StateFadesIn = "FadeIn";
        public const string StateFadesOut = "FadeOut";
        public const string StateBuffer = "Buffer";
        public const string StateBrowse = "Browse";
        public const string StateSearch = "Search";
        public const string StateBrowseAndFilter = "BrowseAndFilter";
        public const string StateIconed = "Iconed";

        public static void GoToState(Control control, bool useTransitions, params string[] stateNames)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            if (stateNames != null)
            {
                foreach (string str in stateNames)
                {
                    if (VisualStateManager.GoToState(control, str, useTransitions))
                    {
                        return;
                    }
                }
            }
        }
    }
}
